package com.atzc.utils.mysql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class MysqlConnect {

    static Connection con = null;

    static {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            con = DriverManager.getConnection("jdbc:mysql://atzcdb.ct5rltsi1wvv.rds.cn-northwest-1.amazonaws.com.cn:3306/test_atzuchedb?useSSL=false&serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8");
        } catch (ClassNotFoundException | SQLException e) {
            System.out.println("-----<<<<< MySQL get connnection has exception <<<<<<-----------");
        }
    }

    public static Connection getConnection() {
        if (con == null)
            System.out.println("mysql的连接异常");
        return con;
    }
}
